﻿//***********************************************************************
 //* Module:  TbBstUserBLL.cs
// * 作者:  曹荣芝
 //* Modified: 2013-03-25
// * Purpose: Definition of the Class XWG.JWBST.AuthBLL.TbBstUserBLL
// ***********************************************************************/
using System;
using System.Data;
using XWG.JWBST;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using XWG.JWBST.JWBSTEntity;
using XWG.Framework.AuthUtility;
namespace XWG.JWBST.JWBSTBLL
{
	/// <summary>
	/// 
	/// </summary>
	public class TbBstUserBLL
	{
        #region 删除操作
                /// <summary>
        /// 删除。
        /// </summary>
        /// <param name="userid">要删除的的主键值。</param>
        /// <param name="isLog">是否写入日志。</param>
        /// <returns>是否成功 1 表示成功 负值代表失败</returns>
        public static ResultModel Delete(object id, object userid, bool isLog)
        {
               return XWG.JWBST.JWBSTDAL.TbBstUserDAL.Delete(id,userid,isLog);
        }
        #endregion
        #region 根据主键查询一条记录
        /// <summary>
        /// 获取实体
        /// </summary>
        /// <param name="userid">主键</param>
        /// <returns>用户实体</returns>
        public static TbBstUser Load(object userid)
        {
              return XWG.JWBST.JWBSTDAL.TbBstUserDAL.Load(userid); 
        }
        #endregion
        #region 查询操作
        /// <summary>
        /// 查询
        /// </summary>
        public static IList<TbBstUser> SelectList()
        {
            return XWG.JWBST.JWBSTDAL.TbBstUserDAL.SelectList();
        }
        #endregion
        #region 插入操作
        /// <summary>
        /// 新增。
        /// </summary>
        /// <param name="info">待新增的信息。</param>
        /// <param name="userid">操作员。</param>
        /// <param name="isLog">是否写入日志。</param>
        /// <returns>新增是否成功的标示。（1：成功；负值失败）</returns>
        public static ResultModel Insert(TbBstUser info, object userid, bool isLog)
        {
              return XWG.JWBST.JWBSTDAL.TbBstUserDAL.Insert(info,userid,isLog);
        }
		#endregion 
        #region 修改操作
        /// <summary>
        /// 修改。
        /// </summary>
        /// <param name="info">待修改的信息。</param>
        /// <param name="userid">操作员。</param>
        /// <param name="isLog">是否写入日志。</param>
        /// <returns>修改是否成功的标示。（1：成功；负值失败）</returns>
        public static ResultModel Update(TbBstUser info, object userid, bool isLog)
        {
           return XWG.JWBST.JWBSTDAL.TbBstUserDAL.Update(info, userid, isLog);
        }
        #endregion 
        #region 查询号码是否注册
        /// <summary>
        /// 查询此电话号码是否注册
        /// </summary>
        /// <param name="PhoneNo">手机号</param>
        /// <returns>i  i = 0可以注册  i > 0 此手机号已经注册</returns>
        public static int SelectUser(string phoneon)
        {
           return XWG.JWBST.JWBSTDAL.TbBstUserDAL.SelectUser(phoneon);
        }
        #endregion
        #region 用户登录
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="phoneon">手机号</param>
        /// <param name="password">密码</param>
        /// <returns>用户的ID</returns>
        public static string UserLogin(string phoneon, string password)
        {
            return XWG.JWBST.JWBSTDAL.TbBstUserDAL.UserLogin(phoneon,password);
        }
		#endregion 
        #region
        /// <summary>
        /// 更新最后登陆时间
        /// </summary>
        /// <param name="uid">用户ID</param>
        public static void Updatetime(string uid)
        {
            XWG.JWBST.JWBSTDAL.TbBstUserDAL.Updatetime(uid);
        }
        #endregion
        //#region
        ///// <summary>
        ///// 获取用户ID
        ///// </summary>
        ///// <param name="phone">手机号</param>
        //public static string GetUserID(string phone)
        //{
        //   return XWG.JWBST.JWBSTDAL.TbBstUserDAL.GetUserID(phone);
        //}
        //#endregion

        public static string ISExist(string phone,string pass)
        {
            return XWG.JWBST.JWBSTDAL.TbBstUserDAL.ISExist(phone,pass);
        }

         /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="pass"></param>
        /// <param name="uid"></param>
        /// <returns></returns>
        public static int ModefiyPass(string pass, string uid)
        {
            return XWG.JWBST.JWBSTDAL.TbBstUserDAL.ModefiyPass(pass,uid);
        }
	}
}
